package com.ls.data.mapper;

import com.ls.interPojo.Weather;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 段成
 * @date 2020/1/9 - 14:13
 */
@Mapper
public interface WeatherMapper {
    @Select("select id,realtime,future,sdate,city FROM tb_weather where city = #{value}")
    List<Weather> getDataByCity(String city);

    @Insert("INSERT INTO `lingsun2`.`tb_weather` (`realtime`, `future`, `sdate`, `city`) VALUES (#{realtime},#{future},#{sdate},#{city})")
    void insertData(Weather insertData);
}
